﻿using System.Reflection;

namespace TSharp.Core.Asm
{
    /// <summary>
    /// 扩展点收集器基类
    /// <para>2010/12/24</para>
    /// 	<para>THINKPADT61</para>
    /// 	<para>tangjingbo</para>
    /// </summary>
    public abstract class ExtensionPoint
    {
        internal ExtensionPoint()
        {
        }

        /// <summary>
        /// 注册扩展
        /// </summary>
        /// <param name="assembly">程序集.</param>
        /// <param name="attribute">扩展.</param>
        internal abstract void Register(Assembly assembly, ExtensionAttribute attribute);

        /// <summary>
        /// 注销扩展
        /// </summary>
        /// <param name="assembly">程序集.</param>
        /// <param name="attribute">扩展.</param>
        internal abstract void UnRegister(Assembly assembly, ExtensionAttribute attribute);

        /// <summary>
        /// 加载时执行
        /// </summary>
        public virtual void OnLoad()
        {
        }

        /// <summary>
        /// 初始化
        /// </summary>
        public virtual void OnInit()
        {
        }
    }
}